package javase0828;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class Demo03 {
    public static void main(String[] args) throws Exception {
        User u = new User("tom", 2);
        ObjectInputStream ois = null;
        ObjectOutputStream oos = null;
        oos = new ObjectOutputStream(new FileOutputStream("d:/hello.txt"));
        oos.writeObject(u);
    }
}
